<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//实例化promise
			const q=new Promise(function(resolve,reject){
				fs.readFile("wenjian/index.txt",(err,data)=>{
					if(err) reject(err);
					resolve(data);
				});
			});
			q.then(function(value){
			alert(value.toString());
			},function(reason){
				alert('读取失败');
			})
		</script>
	</body>
</html>
